﻿// 
function Init()
{
	var GetCk = GetCookie("UrlStr");
	var GetPn = GetPageName();
	var GetMid = GetmainID();
	//alert(document.cookie);
	//alert(GetMid);
	
	if(GetCk == null)
	{
		SetCookie(GetPn);
		//alert(document.cookie);
		document.all("nav_"+GetPn).className = "nav_s";
		getPsi(GetPn,GetMid);
	}
	else
	{
		if(GetCk == GetPn)
		{
			document.all("nav_"+GetPn).className = "nav_s";
			getPsi(GetPn,GetMid);
		}
		else
		{
			SetCookie(GetPn);
			document.all("nav_"+GetPn).className = "nav_s";
			getPsi(GetPn,GetMid);
		}
	}	
}

 

//
function NavView(navID,mouseType)
{
	var GetPn = "nav_"+GetPageName();
	if(navID.id == GetPn)
	{
		document.all(GetPn).className ="nav_h";
		
	}
	else
	{
		if(mouseType==1)
		{
			document.all(GetPn).className ="nav_s";
			document.all(navID.id).className ="nav_h";
		}
		else
		{
			document.all(GetPn).className ="nav_s";
			document.all(navID.id).className ="nav_f2_div";
		}
	}
	
	
}

//
function Popmenu(navID,divStyle,popType)
{
	if (popType>=0)
	{
		if(divStyle==1)
			{
				document.all("div"+navID.id).style.display="block";
			}
		else
			{
				document.all("div"+navID.id).style.display="none";
			}
	}
	else
	{
	
	}
	
}

//
function gotoURL(URL) 
{
	window.location = URL;
}

//
function ltbNav(navID,mouseType,popType)
{
	//alert(navID);return false;
	NavView(navID,mouseType);
	Popmenu(navID,mouseType,popType);
}

//
function SetCookie(sValue)
{
  //alert(sValue);
  date = new Date();
  document.cookie = "UrlStr=" + escape(sValue);
}
 
//
function GetCookie(sName)
{
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }
  return null;
}


//
function GetPageName()
{
	var localURL = document.location.toString();
	var catchID = window.location.href.indexOf('?');
	var catchName1 = window.location.href.lastIndexOf('/');
	var catchName2 = window.location.href.lastIndexOf('.');
	var castchAllName = localURL.substring(catchName1+1,catchName2);
	
	return castchAllName;
}

//
function GetmainID()
{
	var mainID;
	var localURL = document.location.toString();
	var catchID = window.location.href.indexOf('?');
	var catchName1 = window.location.href.lastIndexOf('/');
	var catchName2 = window.location.href.lastIndexOf('.');
	var castchAllName = localURL.substring(catchName1+1,catchName2);
	if(catchID>1)
	{
		mainID = Math.abs(parseInt(unescape(localURL.substring(localURL.indexOf("=")+1,localURL.length))));
		return mainID;
	}
	else
	{
		//alert(castchAllName);
		switch(castchAllName)
		{
			case "index":{return mainID = parseInt(-1);}
						break;
			
			case "contact":{return mainID = parseInt(0);}
						break;
			case "map":{return mainID = parseInt(0);}
						break;
			case "platform":{return mainID = parseInt(0);}
						break;
			
			case "hr":{return mainID = parseInt(1);}
						break;									
			case "about":{return mainID = parseInt(1);}
						break;
			case "news":{return mainID = parseInt(1);}
						break;
			case "services":{return mainID = parseInt(1);}
						break;
			case "product":{return mainID = parseInt(1);}
						break;
			case "education":{return mainID = parseInt(1);}
						break;
			case "support":{return mainID = parseInt(1);}
						break;
			case "visit":{return mainID = parseInt(1);}
						break;

		}
		
	}	
}

//
function autoResize()
{
	//alert(document.all.ifmMain.readyState)
	if(  document.all.ifmMain.readyState == "complete" )
	{
		try
		{
			var sHeight=window.frames["ifmMain"].document.body.scrollHeight;
			//alert(sHeight);
			if(sHeight<400)
			{
				sHeight="400px";
			}
			document.all.ifmMain.style.height = sHeight;					
		}
		catch(e)
		{}
	}
}

//
function getPsi(navID,mainID)
{
	var catchTle;
	var catchTxt;
	//alert(navID+";"+mainID)
	
	if(mainID>=1)
	{
		switch(navID)  
		{
			case 'index':{catchTle="首页";}
						      break;
			case 'about':{catchTle="关于中心";
								if((mainID>=1)&&(mainID<=4))
								{
									switch(mainID)
									{ 
										case 1:{catchTxt="－中心简介"}
													break;
										case 2:{catchTxt="－服务体系"}
													break;
										case 3:{catchTxt="－精英团队"}
													break;
										case 4:{catchTxt="－公共服务平台"}
													break;
										default:{catchTxt="－中心简介"}
													break;
									}	
								}
								else
								{
									mainID = "1";
									catchTxt="－中心简介";
								}
								
							}
						    break;
			case 'news':{catchTle="新闻资讯";
								if((mainID>=1)&&(mainID<=2))
								{
									switch(mainID)
									{
										case 1:{catchTxt="－业界新闻"}
													break;
										case 2:{catchTxt="－中心动态"}
									}	
								}
								else
								{
									mainID = "1";
									catchTxt="－业界新闻";
								}
							  }
						      break;
			case 'services':{catchTle="中心服务";
								if((mainID>=1)&&(mainID<=3))
								{
									switch(mainID)
									{
										case 1:{catchTxt="－产品体验"}
													break;
										case 2:{catchTxt="－产品研发"}
													break;
										case 3:{catchTxt="－信息交流"}
													break;
									}	
								}
								else
								{
									mainID = "1";
									catchTxt="－产品体验";
								}
							  }
						      break;
			case 'product':{catchTle="软件产品 ";
								if((mainID>=1)&&(mainID<=2))
								{
									switch(mainID)
									{
										case 1:{catchTxt="－行业解决方案"}
													break;
										case 2:{catchTxt="－微软产品销售"}
													break;
									}	
								}
								else
								{
									mainID = "1";
									catchTxt="－行业解决方案";
								}
							  }
						      break;

			case 'education':{catchTle="教育培训与认证 ";
								if((mainID>=1)&&(mainID<=2))
								{
									switch(mainID)
									{
										case 1:{catchTxt="－服务对象及内容 "}
													break;
										case 2:{catchTxt="－机制与设施"}
													break;
									}
								}
								else
								{
									mainID = "1";
									catchTxt="－服务对象及内容";
								}	
							  }
						      break;
			
			case 'hr':{catchTle="诚聘英才";
								if((mainID>=1)&&(mainID<=9))
								{
									switch(mainID)
									{
										case 1:{catchTxt=""} 
													break;
										case 2:{catchTxt="－社会招聘－．Net项目经理"}
													break;
										case 3:{catchTxt="－社会招聘－．Net高级软件工程师"}
													break;
										case 4:{catchTxt="－社会招聘－．Net软件工程师"}
													break;
										case 5:{catchTxt="－社会招聘－微软产品客户经理"}
													break;
										case 6:{catchTxt="－社会招聘－政府行业客户经理"}
													break;
										case 7:{catchTxt="－社会招聘－资深售前工程师"}
													break;
										case 8:{catchTxt="－社会招聘－公共关系经理"}
													break;
										case 9:{catchTxt="－社会招聘－系统工程师"}
													break;
									}	
								 }
								else
								{
									mainID = "1";
									catchTxt="";
								}	
								 
							  }
						      break;
						   
			case 'support':{catchTle="技术支持与咨询  ";
								if((mainID>=1)&&(mainID<=3))
								{
									switch(mainID)
									{
										case 1:{catchTxt="－IT规划与部署 "}
													break;
										case 2:{catchTxt="－系统运维服务"}
													break;
										case 3:{catchTxt="－咨询顾问服务"}
													break;
									}	
								 }
								else
								{
									mainID = "1";
									catchTxt="－IT规划与部署";
								}	
								 
							  }
						      break;
			case 'visit':{catchTle="参观中心  ";
								if((mainID>=1)&&(mainID<=8))
								{
									switch(mainID) 
									{
										case 1:{catchTxt="－数据中心 "}
													break;
										case 2:{catchTxt="－培训教室"}
													break;
										case 3:{catchTxt="－顾问开发室"}
													break;
										case 4:{catchTxt="－咨询服务室 "}
													break;
										case 5:{catchTxt="－产品体验区"}
													break;
										case 6:{catchTxt="－员工办公区 "}
													break;
										case 7:{catchTxt="－来访接待区"}
													break;
										case 8:{catchTxt="－休闲活动区  "}
													break;
									}	
								 }
								else
								{
									mainID = "1";
									catchTxt="－数据中心";
								}	
								
							  }
						      break;
		}
		document.all("sub_bn").src = "themes/dfstyle/bn_"+navID+".jpg";	
		document.all("sub_psi").innerText = catchTle+catchTxt;	
		document.all("ifmMain").src="modules/"+navID+"/iform"+mainID+".aspx";
		setVariables();checkLocation()
		
	}
	else
	{
		if(mainID == 0)
		{
			switch(navID)
			{
				/*case "hr":{catchTle="诚聘英才";}
							break;*/
				case "contact":{catchTle="联系我们";}
							break;
				case "map":{catchTle="站点地图";} 
							break;
				case "platform":{catchTle="公共服务平台";}
							break;
			}
			//alert(catchTle);
			document.all("sub_bn").src = "themes/dfstyle/bn_"+navID+".jpg";	
			document.all("sub_psi").innerText = catchTle;
			if(navID=="hr")
			{
				setVariables();checkLocation() 
			}
			if(navID=="platform")
			{
				setVariables();checkLocation() 
			}
		}
		else
		{
			
		}
	}
}   

//
function openWin(URL,title,form)
{
	window.open(URL,title,form)
}

//
function setVariables() {
if (navigator.appName == "Netscape") {
v=".top=";
dS="document.";
sD="";
y="window.pageYOffset";
}
else {
v=".pixelTop=90+";
dS="";
sD=".style";
y="document.body.scrollTop";
}
}

//
function checkLocation() {
object="object1";
//alert(eval(y));
yy=eval(y);
eval(dS+object+sD+v+yy);
setTimeout("checkLocation()",10);
}


//
var bannerAD=new Array(); 
var bannerADlink=new Array(); 
var adNum=0; 

bannerAD[0]="themes/dfstyle/hr_news_01.jpg"; 
bannerADlink[0]="http://www.bingosoft.net/modules/hr/2008campushr/index.aspx"; 
bannerAD[1]="themes/dfstyle/hr_news_02.jpg"; 
bannerADlink[1]="http://www.bingosoft.net/modules/hr/2008campushr/index.aspx"; 
bannerAD[2]="themes/dfstyle/hr_news_03.jpg"; 
bannerADlink[2]="http://www.bingosoft.net/modules/hr/2008campushr/index.aspx"; 
bannerAD[3]="themes/dfstyle/hr_news_04.jpg"; 
bannerADlink[3]="http://www.bingosoft.net/modules/hr/2008campushr/index.aspx"; 
bannerAD[4]="themes/dfstyle/hr_news_05.jpg"; 
bannerADlink[4]="http://www.bingosoft.net/modules/hr/2008campushr/index.aspx"; 



var preloadedimages=new Array(); 
for (i=1;i<bannerAD.length;i++){ 
preloadedimages[i]=new Image(); 
preloadedimages[i].src=bannerAD[i]; 
} 


function setTransition(){ 
if (document.all){ 
document.all("bannerADrotator").filters.revealTrans.Transition=Math.floor(Math.random()*23); 
document.all("bannerADrotator").filters.revealTrans.apply(); 
} 
} 

function playTransition(){ 
if (document.all) 
document.all("bannerADrotator").filters.revealTrans.play() 
} 

function nextAd(){ 

if(adNum<bannerAD.length-1)adNum++ ; 
else adNum=0; 
setTransition(); 
document.images.bannerADrotator.src=bannerAD[adNum]; 
playTransition(); 
theTimer=setTimeout("nextAd()", 4000); 
} 

function jump2url(){ 
jumpUrl=bannerADlink[adNum]; 
jumpTarget='_self'; 
if (jumpUrl != ''){ 
if (jumpTarget != '')window.open(jumpUrl,jumpTarget); 
else location.href=jumpUrl; 
} 
} 
function displayStatusMsg() { 
status=bannerADlink[adNum]; 
document.returnValue = true; 
} 